import pdfplumber
# 读取PDF文件
def read_pdf(file_path):
    with pdfplumber.open(file_path) as pdf:
        all_text = ""
        for page in pdf.pages:
            all_text += page.extract_text()
    return all_text


if __name__ == '__main__':
    file_path = 'C:/Users/sune/Desktop/新建文件夹/1.pdf'
    text = read_pdf(file_path)
    print(text)